from socf.server.remote import ServicePool

class Service:

    def setDriver(self, driver):        
        self.__driver = driver

    def getDriver(self):
        return self.__driver

class DiscoveryService(Service):

    def __init__(self):
        pass
    
    #gets the list of current registered services
    def getCurrentServicesList(self):
        return ServicePool.getServiceInfoList()

class GPSService(Service):
    
    def __init__(self):
        pass
    
    # returns - (lat, lon, alt, speed, dir, time - (HH, MM, SS, MS), date(YY, MM, DD), status1, status2)
    # status2 - altitute available
    # status1 - lat, lon etc.. available
    def getLocation(self):
        return self.getDriver().getLocation()

class SonarService(Service):
    
    def __init__(self):
        pass
    
    def getDistance(self):
        return self.getDriver().getDistance()

class CompassService(Service):
    
    def __init__(self):
        pass
    
    def getDirection(self):
        return self.getDriver().getDirection()

class  MetalDetectorService(Service):
    
    def __init__(self):
        pass
    
    def getMines(self):
        return self.getDriver().getMines()

class NavigationService(Service):
    
    def __init__(self):
        pass
    
    def moveUp(self):
        self.getDriver().moveUp()

    def moveDown(self):
        self.getDriver().moveDown()
    
    def moveLeft(self):
        self.getDriver().moveLeft()
    
    def moveRight(self):
        self.getDriver().moveRight()
    
    def setSpeed(self, speed):
        self.getDriver().setSpeed()
    
    def stop(self):
        self.getDriver().stop()

